function EFFECT:Init(data)

	self.Heirach = data:GetEntity()
	self.Entity:SetPos(data:GetOrigin())
	self.Color = Color(data:GetStart().x, data:GetStart().y, data:GetStart().z, 255)
	self.Size = data:GetRadius()
	
	if (self.Heirach != NULL) and (self.Heirach:IsValid()) then
		self.Entity:SetParent(self.Heirach)
	end

	self.SpriteMode = data:GetScale()
	
	self.LifeTime = data:GetMagnitude()
	self.StartTime = CurTime()
	
	if (self.SpriteMode == 1) then
		self.Mat = Material("Sprites/animglow02")
	elseif (self.SpriteMode == 2) then
		self.Mat = Material("Sprites/glow01")
	elseif (self.SpriteMode == 3) then
		self.Mat = Material("Sprites/glow1")
	elseif (self.SpriteMode == 4) then
		self.Mat = Material("Sprites/glow06")
	elseif (self.SpriteMode == 5) then
		self.Mat = Material("Sprites/lamphalo1")
	elseif (self.SpriteMode == 6) then
		self.Mat = Material("Sprites/light_glow01")
	elseif (self.SpriteMode == 7) then
		self.Mat = Material("effects/strider_pinch_dudv")
	elseif (self.SpriteMode == 8) then
		self.Mat = Material("Sprites/blueflare1")
	end
	
	if (self.SpriteMode != 7) then
		self.Mat:SetMaterialInt("$spriterendermode",5)
		--self.Mat:SetMaterialInt("$ignorez",1)
		self.Mat:SetMaterialInt("$illumfactor",8)
	end
	
	self.Alpha = 1
	
	local boundlimit = Vector(32768,32768,32768)
	self.Entity:SetRenderBoundsWS(-1*boundlimit,boundlimit)
end

function EFFECT:Think()
	if (self.Alpha <= 0) then
		return false
	else
		self.Alpha = 1 - math.Clamp(((CurTime() - self.StartTime) / self.LifeTime), 0, 1)
		return true
	end
end

function EFFECT:Render()
	
	self.Color.a = self.Alpha * 255
	
	render.SetMaterial(self.Mat)
	if self.SpriteMode == 7 then render.UpdateRefractTexture() end
	render.DrawSprite(self.Entity:GetPos(), self.Size, self.Size, self.Color)
					 
end
